home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / ask_bat.zip / ASK_BAT.DOC < prev    next >
Text File  |  1989-02-17  |  5KB  |  104 lines

  1.        program: ask_bat
  2.  
  3.        Copyright 1989 Floyd D. Pretz Sr.
  4.                       5834 Spaulding St.
  5.                       Omaha, NE  68104
  6.  
  7.        Distribution of this program for non-commercial purposes
  8.        is permitted.  Author assumes no liability for losses due to
  9.        malfunction of this program.
  10.  
  11.        Description:  The ask_bat program was designed to allow
  12.                      for timed response to (Y/N) type prompts
  13.                      in .BAT files - esp the Autoexec.bat file.
  14.                      The program was written to satisfy a need
  15.                      to recover from a system reboot of a BBS
  16.                      (Bulletin Board System) following the loss
  17.                      of modem carrier, and still allow the system
  18.                      operator (if present) to answer typical
  19.                      configuration 'boot' questions.  Using ask_bat
  20.                      with timing options, the system will not wait
  21.                      indefinitely for console response, but will assume
  22.                      a default response after a specified period of
  23.                      time.  This also allows you the opportunity to
  24.                      go fill your coffee cup during the boot process
  25.                      and not wait around to answer batch prompts.
  26.  
  27. Use: ask_bat [ "string" errlev ... ] [ /T:nnn ] [ /H ] [ /F ] [ /P "prompt" ]
  28.  
  29.                 where: 'string' is an optional keyboard (console)
  30.                         response to which the program will exit with
  31.                         an ERRORLEVEL set to errlev.  You can use as
  32.                         many of the 'string'-errlev sets as you wish
  33.                         (DOS command line can not exceed 128 characters).
  34.                         The absence of any such pairs will function
  35.                         as 'Press any key to continue' with the
  36.                         errorlevel set to 0.  'string' is not case
  37.                         sensitive (i.e.  'Yes', 'YES' & 'yEs' are
  38.                         treated identically).
  39.  
  40.                         /T:nnn is an option to time keyboard activity
  41.                         and exit ask_bat after nnn seconds.  If the
  42.                         /T parameter is not specified or nnn=0 then
  43.                         keyboard activity is not timed and ask_bat will
  44.                         wait indefinitely for console activity.  In the
  45.                         case of a time out (user did not respond within
  46.                         nnn seconds) the default is assumed to be the
  47.                         first 'string'-errlev parameter (if any).
  48.                         The default is also assumed if the console
  49.                         response is null (Enter key only).
  50.  
  51.                         /H is an option to enable a HOT KEY feature
  52.                         which attempts to match a single keystroke
  53.                         to one of the 'string' parameters and exit
  54.                         accordingly.
  55.  
  56.                          /F is an option to force the user to key in
  57.                         one of the 'strings' in order to exit the program.
  58.                         the program will 'beep' if an incorrect entry
  59.                         is detected.
  60.  
  61.                         /P prompt is an option to display a string on the
  62.                         screen without forcing a <RETURN>.
  63.  
  64.                         Invocation without any parameters will function
  65.                         similar to the DOS PAUSE statement.
  66.  
  67.              examples:        ask_bat yes 1 no 2 maybe 3 /T:15 /H
  68.  
  69.                                  will exit with errorlevel=1 if the
  70.                                  character 'Y' or 'y' is pressed or
  71.                                  if 15 seconds elapses or only the
  72.                                  <RETURN> key is pressed.  Also exits with
  73.                                  errorlevel=2 if 'N' or 'n' is pressed
  74.                                  and exits with errorlevel=3 if 'M' or
  75.                                  'm' is pressed.
  76.  
  77.                         ask_bat /H
  78.  
  79.                                  Functions similar to the PAUSE command.
  80.  
  81.                         ask_bat tom 10 dick 20 /F
  82.  
  83.                                  Will exit with errorlevel=10 if 'TOM',
  84.                                  'tom', 'Tom', etc is keyed in, or exit
  85.                                  with errorlevel=20 if 'Dick', etc is keyed
  86.                                  in. Because of the '/F' parameter one
  87.                                  of these two responses must be keyed in
  88.                                  in order for ask_bat to exit.
  89.  
  90.                         ask_bat yes 3 no 2 /H /T:15 /P "Continue --> "
  91.  
  92.                                  Will display the prompt string and then
  93.                                  wait up to 15 seconds for a hot key.
  94.  
  95.                         ask_bat ? > readme.txt
  96.  
  97.                                  This will create the readme.txt file
  98.                                  which you can later print. Or ...
  99.  
  100.                         ask_bat ? | more
  101.  
  102.                                  Which will force the screen to pause
  103.                                  while you read the help text.
  104.